import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { MainComponent } from "./component/main/main.component";
import { LayerComponent } from "./component/layer/layer.component";


const routes: Routes = [
    {
        path : 'layer',
        component : LayerComponent,
        outlet : 'propup'
    },
    {
        path: 'login',
        loadChildren: () => new Promise(resolve => {
            (require as any).ensure([], () => {
                resolve(require('../page/login/login.module').LoginModule);
            })
        })
    },
    {
        path: '',
        component: MainComponent,
        children: [
            {
                path: 'register',
                loadChildren: () => new Promise(resolve => {
                    (require as any).ensure([], () => {
                        resolve(require('../page/register/register.module').RegisterModule);
                    })
                })
            }
        ]
    }
]

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class CoreRoutingModule {

}